package com.zxf.appliction;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//注解“@RestController”和”@RequestMapping”由 Spring MVC 提供，用来创建 REST 服务。这两个注解和 Spring Boot 本身并没有关系。
@Controller
//注解的作用在于让 Spring Boot 根据应用所声明的依赖来对 Spring 框架进行自动配置，这就减少了开发人员的工作量
@SpringBootApplication
@EnableAutoConfiguration
@MapperScan(basePackages="com.zxf.appliction.dao")
@Configuration
public class Appliction {


	@RequestMapping("/") 
	public @ResponseBody String home() {
		
		return "Hello World!";
	}
	  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {  
	        return application.sources(Appliction.class);  
	    }  
	public static void main(String[] args){
		
		SpringApplication.run(Appliction.class, args); 
	}
}
